package com.example.csdn.DTO;

import com.example.csdn.anno.State;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import java.time.LocalDateTime;

@Data
public class ArticleAddDTO {

    private Integer id;//文章id
    @NotEmpty
    @Pattern(regexp = "^\\S{1,10}$")
    private String title;//文章标题
    @NotEmpty
    private String content;//文章内容
    private Integer viewCount;//浏览量
    private Integer likeCount;//点赞量

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @NotNull
    private Integer categoryId;//这个文章的分类的id


    private Integer userId;//这个文章的作者的id
    @NotEmpty

    @State
    private String state;//状态

    @NotEmpty
    @URL
    private String coverImg;//封面图像
}
